// 在vue cli框架中@表示指向src目录
// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 订单管理
 */
// 待分配订单
import waitAssign from '@/views/order/waitAssign';
// 待支付订单
import waitPay from '@/views/order/waitPay';
// 已完成订单
import finishOrder from '@/views/order/finishOrder';
/**
 * 分类管理
 */
// 分类设置
import item from '@/views/item/item';
// 分类明细
import itemDetail from '@/views/item/itemDetail';
/**
 * 用户管理
 */
// 用户管理
import user from '@/views/system/user';
// 角色管理
import Role from '@/views/system/Role';
// 后台管理
import Dept from '@/views/system/Dept';
/**
 * 设置
 */
// 设置
import Config from '@/views/pay/Config';




// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [ 
            {
                path: '/item/item',
                name: '分类设置',
                component: item,
                meta: {
                    requireAuth: true
                }
            }, 
            {
                path: '/item/itemDetail',
                name: '分类明细',
                component: itemDetail,
                meta: {
                    requireAuth: true
                }
            }, 
            {
                path: '/order/waitAssign',
                name: '待分配订单',
                component: waitAssign,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/order/waitPay',
                name: '待支付订单',
                component: waitPay,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/order/finishOrder',
                name: '已完成订单',
                component: finishOrder,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/system/user',
                name: '用户管理',
                component: user,
                meta: {
                    requireAuth: true
                }
            }, {
                path: '/system/Role',
                name: '骑手管理',
                component: Role,
                meta: {
                    requireAuth: true
                }
            }, {
                path: '/system/Dept',
                name: '后台用户',
                component: Dept,
                meta: {
                    requireAuth: true
                }
            }, {
                path: '/pay/Config',
                name: '设置',
                component: Config,
                meta: {
                    requireAuth: true
                }
            }
        ]
    }]
})